﻿using AngleExpress.utils;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AngleExpress.software
{
    class YuanTongExpress : ISoftware
    {
        private readonly string ExePath = System.AppDomain.CurrentDomain.BaseDirectory + @"yt\Express.exe";
        public override void OpenSoftware(string username, string password, string otherParam)
        {
            TextLog.Add(ExePath);
            var index = ExePath.LastIndexOf('\\');
            if (index == -1)
            {
                throw new Exception("文件目录路径非法!");
            }
            var workDir = ExePath.Substring(0, index);
            ProcessStartInfo info = new ProcessStartInfo
            {
                UseShellExecute = true,
                FileName = ExePath,
                WorkingDirectory = workDir
            };
            try
            {
                Process pro = Process.Start(info);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
    }
}
